package com.kingyun.gpsinspection.purificationservice.services.jsm.innerservice.impl.employee;

import com.kingyun.gpsinspection.purificationservice.dao.mapper.jsm.JsmCertificateTypeMapper;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.CertificateType;
import com.kingyun.gpsinspection.purificationservice.facade.service.jsm.employee.JsmCertificateTypeService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Created by zmling on 2016/11/24.
 * 证书类型信息
 */

public class JsmCertificateTypeServiceImpl implements JsmCertificateTypeService {

    @Autowired
    private JsmCertificateTypeMapper certificateTypeMapper;

    /**
     * 新增
     *
     * @param certificateType
     * @throws Exception
     */
    @Override
    public void addcertificateType(CertificateType certificateType) throws Exception {
        certificateTypeMapper.insertSelective(certificateType);
    }

    /**
     * 查詢所有
     *
     * @return
     * @throws Exception
     */
    @Override
    public List<CertificateType> findCertificateTypeList() throws Exception {
        return certificateTypeMapper.findCertificateTypeList();
    }

    /**
     * 查询
     *
     * @param name
     * @return
     * @throws Exception
     */
    @Override
    public CertificateType findCertificateType(String name) throws Exception {
        return certificateTypeMapper.selectByPrimaryKey(name);
    }
}
